package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 采购车实体类
 */
@Data
@NoArgsConstructor
@TableName("t_buycar")
public class BuyCarBean {
    @TableId(value = "pk_buyCarId",type = IdType.AUTO)
    private Integer id;

    @TableField("fk_productId")
    private Integer productId;
    @TableField(exist = false)
    private ProductBean product;

    /**
     * 采购数量
     */
    @TableField("bc_num")
    private Integer num;


    /**
     * 采购价
     */
    @TableField("bc_price")
    private Integer price;
    /**
     * 采购员ID
     */
    @TableField("fk_userId")
    private Integer userId;
    @TableField(exist = false)
    private UserBean user;

    public BuyCarBean(Integer productId, Integer num, Integer price, Integer userId) {
        this.productId = productId;
        this.num = num;
        this.price = price;
        this.userId = userId;
    }

    @Override
    public String toString() {
        return "BuyCarBean{" +
                "id=" + id +
                ", productId=" + productId +
                ", product=" + product +
                ", num=" + num +
                ", price=" + price +
                ", user=" + user +
                '}'+"\n";
    }
}
